the txt is that:
Code:
001.645.2
Learning C++
Gregory Harrison
1
001.721.3
C++ for Beginners
Quentin Resnick
2
25 9 1999
Me
001.384.2
C++ Tools
Kieren Legrande
1
the reading is:
Code:
while(!InData.eof())
{
InData.getline(Database[NumBooks].CallNumber,MaxCallNumber+1,'\n');
InData.getline(Database[NumBooks].Title,MaxTitle,'\n');
InData.getline(Database[NumBooks].Author,MaxAuthor,'\n');
InData.getline(Database[NumBooks].BookStatus,MaxBookStatus,'\n');
if (Database[NumBooks].BookStatus[0]=='2')
{
InData.getline(Database[NumBooks].DueDate,MaxDueDate);
for (int i = 0; i < MaxDueDate; i++)
{
if (Database[NumBooks].DueDate[i] == ' ')
Database[NumBooks].DueDate[i] = '/';
}
InData.getline(Database[NumBooks].BorrowersName,MaxBorrowersName,'\n');
}
else
{
strcpy(Database[NumBooks].DueDate,"N/A");
strcpy(Database[NumBooks].BorrowersName,"N/A");
}
NumBooks++;
}
InData.close();
cout << "Txt file was successfully loaded!" << endl;
i think the reading has problem... but i dunno how to read... was i right to write like that?